package com.chhuang.ewcrm.bean;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

/**
 * @author chhuang
 * @create 2020-10-24-16:44
 */
@Data
@NoArgsConstructor
@AllArgsConstructor
public class TableColumnBean {

    public TableColumnBean(String columnName, String recordName) {
        this.columnName = columnName;
        this.recordName = recordName;
    }

    /**
     *
     * @param columnName
     * @param recordName
     * @param sort 默认false 不支持排序
     */
    public TableColumnBean(String columnName, String recordName, boolean sort) {
        this.columnName = columnName;
        this.recordName = recordName;
        this.sort = sort;
    }

    /**
     *
     * @param columnName
     * @param recordName
     * @param sort 默认false 不支持排序
     * @param visible 默认true 显示
     */
    public TableColumnBean(String columnName, String recordName, boolean sort, boolean visible) {
        this.columnName = columnName;
        this.recordName = recordName;
        this.sort = sort;
        this.visible = visible;
    }

    private String columnName;
    private String recordName;
    private boolean sort = false;
    private boolean visible = true;
    private Integer columnWidth;

    public String format(Object o){
        return o==null?null:o.toString();
    };
}
